package com.lfy.spring.bean;

import jakarta.annotation.PostConstruct;
import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * @author leifengyang
 * @version 1.0
 * @date 2025/8/9 20:25
 * @description:
 */
@Data
@Component
public class Cat {

    private String name;
    private String color;


    public Cat(){
        System.out.println("Cat 无参构造");
    }

    //每个方法都可以不再去关注 try-catch 逻辑。可以由切面统一做
    public void hahah(){
        System.out.println("hahah");
    }

    @PostConstruct
    public void helloInit(){
        System.out.println("Cat Bean 初始化方法");


    }
}
